package cn.bobmao.exts.example.mapper.user;

import cn.bobmao.exts.example.domain.user.Account;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AccountMapper {

    /**
     * 获取所有账号，参考 AccountMapper.xml
     */
    List<Account> findAll();

    /**
     * 获取账号 (字段 sex 通过别名映射器处理)
     */
    @Select("SELECT id, name, username, sex FROM `account_[SET-TENANTID]` WHERE `id` = #{id}")
    Account find(String id);

}
